package com.yueke.gemini.common;

import com.alibaba.fastjson.JSON;
import com.yueke.gemini.entity.Code;

/**
 * Created by admin on 2019/3/5.
 */
public final class ApiResult<T> {

    private int code;
    private String message;
    private T data;


    public ApiResult() {
        this.code = Code.OK.getId();
        this.message = "ok";
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
